import React from 'react'

import { Avatar, List, Space } from 'antd-mobile'
import { useNavigate } from 'react-router-dom'
function Index() {
  let nav=useNavigate()
  let userinfo = JSON.parse(localStorage.getItem('userinfo'))||{}
  return (
    <div>
      <div style={{  alignItems: 'center' ,margin:'20px',display:userinfo=={}?'none':'block'}}>
        <img style={{width:'40px',height:'40px'}} src={userinfo.avatar} alt="" />
        <span>{userinfo.nickname}</span>
        {/* <img src={userinfo.avatar} alt="" /> */}
      </div>
       <div style={{  alignItems: 'center' ,margin:'20px',display:userinfo=={}?'block':'none'}}>
        <Avatar src='' />
        <span onClick={()=>nav('/login')}>请先登录</span>
      </div>
    </div>
  )
}

export default Index
